package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	gorm.Model
	Name   string `gorm:"type:varchar(64);not null;default:'';comment:'用户名';uniqueIndex:name"`
	Passwd string `gorm:"type:varchar(64);not null;default:'';comment:'密码';"`
}

func (u User) TableName() string {
	return "user"
}

type UserFreind struct {
	UserId         uint      `gorm:"not null;default:0;comment:'用户id';uniqueIndex:user_friend"`
	FriendId       uint      `gorm:"not null;default:0;comment:'好友id';uniqueIndex:user_friend"`
	RelatedAt      time.Time `gorm:"comment:'成为好友时间'"`
	LastAccessedAt time.Time `gorm:"comment:'最后查看时间'"`
	DeletedAt      int64     `gorm:"comment:'删除时间'"`
}

func (f UserFreind) TableName() string {
	return "user_freind"
}

type ListUserParam struct {
	Keyword   string
	PageIndex int
	PageSize  int
	Order     string
}
